package com.skj.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Style;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.dom.client.ScrollEvent;
import com.google.gwt.event.dom.client.ScrollHandler;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
public class home implements EntryPoint , ResizeHandler , MouseOverHandler , MouseOutHandler, MouseDownHandler, MouseUpHandler
{
	// ------------------------------ GLOBAL VARIABLES --------------------------- //
	private Document d ;
	
	private int maxX ;
	private int maxY ;
	
	// TEMPLATE IMAGES
	private Image CornerTopLeft ;
	private Image CornerTopRight ;
	private Image CornerBottomLeft ;
	private Image CornerBottomRight ;
	private Image TopBorder ;
	private Image LeftBorder ;
	private Image RightBorder ;
	private Image BottomBorder ;
	
	private Image BottomMenuLeftBorder ;
	private Image BottomMenuMiddle ;
	private Image BottomMenuRightBorder ;
	
	private Image SKJLogo ;
	
	// HTML
	private HTML profile ;
	
	
	// ------------------------------ GLOBAL VARIABLES --------------------------- //
	
	public void onModuleLoad()
	{
		Window.addResizeHandler(this) ;
		Window.enableScrolling(false) ;
		
		d = Document.get() ;
		maxX = d.getClientWidth() ;
		maxY = d.getClientHeight() ;
		
		RootPanel rp = RootPanel.get() ;
		
		// TEMPLATE IMAGES
		CornerTopLeft 		= new Image("res/CornerTopLeft.png") ;
		CornerTopRight 		= new Image("res/CornerTopRight.png") ;
		CornerBottomLeft 	= new Image("res/CornerBottomLeft.png") ;
		CornerBottomRight 	= new Image("res/CornerBottomRight.png") ;
		TopBorder 			= new Image("res/TopBorder.png") ;
		LeftBorder 			= new Image("res/LeftBorder.png") ;
		BottomBorder 		= new Image("res/BottomBorder.png") ;
		RightBorder 		= new Image("res/RightBorder.png") ;
		
		CornerTopLeft.setSize("26px", "22px") ;
		
		int CornerTopRightX 	= maxX - 22 ;
		CornerTopRight.setSize("26px", "22px") ;
		
		int CornerBottomY 		= maxY - 21 ;
		CornerBottomLeft.setSize("26px", "21px") ;
		CornerBottomRight.setSize("26px", "21px") ;
		
		int TopBorderWidth 	= maxX - 44 ;
		TopBorder.setSize(String.valueOf(TopBorderWidth) + "px", "22px") ;
		
		int VerticalBorderHeight = CornerBottomY - 50 ;
		LeftBorder.setSize("26px", String.valueOf(VerticalBorderHeight) + "px") ;
		RightBorder.setSize("26px", String.valueOf(VerticalBorderHeight) + "px") ;
		
		int BottomBorderWidth = CornerTopRightX - 26 ;
		BottomBorder.setSize(String.valueOf(BottomBorderWidth) + "px", "21px") ;
		int BottomBorderY 		= maxY - 21 ;
		
		rp.add(CornerTopLeft	, 0					, 0			) ;
		rp.add(CornerTopRight	, CornerTopRightX	, 0			) ;
		rp.add(CornerBottomLeft	, 0					, CornerBottomY) ;
		rp.add(CornerBottomRight, CornerTopRightX	, CornerBottomY) ;
		
		rp.add(TopBorder		, 26	 			, 0		) ;
		rp.add(LeftBorder		, 0					, 22	) ;
		rp.add(RightBorder		, CornerTopRightX	, 22	) ;
		rp.add(BottomBorder		, 26				, BottomBorderY	) ;
		
		// SKJ Logo
		SKJLogo	= new Image("res/SKJLogo.png") ;
		rp.add(SKJLogo			, 20						 , 20						) ;
		
		// Bottom Menu
		BottomMenuLeftBorder	= new Image("res/BottomMenuLeftBorder.png") ;
		BottomMenuMiddle 		= new Image("res/BottomMenuMiddle.png") ;
		BottomMenuRightBorder	= new Image("res/BottomMenuRightBorder.png") ;
		
		BottomMenuMiddle.setSize(String.valueOf(BottomBorderWidth) + "px","28px") ;
		
		int BottomMenuRightBorderX	= 26 + BottomBorderWidth ;
		
		int BottomMenuY = CornerBottomLeft.getAbsoluteTop() - 28 ;
		
		rp.add(BottomMenuLeftBorder	,0  	, BottomMenuY) ;
		rp.add(BottomMenuMiddle		,26  	, BottomMenuY) ;
		rp.add(BottomMenuRightBorder,BottomMenuRightBorderX , BottomMenuY) ;
		
		// BODY CODE
		profile = new HTML() ;
		
		profile.setHTML("SKJ Technologies Pvt. Ltd is a start up that believes in simplicity and innovation. We believe in open technologies and free thinking. Currently we are in the process of incubating a new technology which we believe will help in developing information applications without any technical knowledge. It will help people to create virtual teams working on real world jobs very quickly. We have named our product as 'SKJ Platform'." +
				"<br>" +
				"SKJ Technologies Pvt. Ltd Sites:" +
				"<br>" +
				"<ul>" +
				"<li><a href=\"http://platform.skjworld.com\">platform.skjworld.com</a></li>" +
				"<li><a href=\"http://library.skjworld.com\">library.skjworld.com</a></li>" +
				"</ul>" +
				"<br>" +
				"We were earlier working on mobile technologies under 'Swatantar Associates Pvt. Ltd'. We were initially helped by Nokia in 2002 to venture into J2ME space. Earlier we were supplying games to Reliance Communications Ltd and Tata Teleservices Ltd. We have trained many big corporates and start ups on Java ME (J2ME) including among others:" +
				"<br>" +
				"<ul>" +
				"<li>Reliance Communications Ltd</li>" +
				"<li>Skyworks</li>" +
				"<li>CSC</li>" +
				"<li>Mahindra Satyam</li>" +
				"<li>Aztecsoft (Now merged into Mindtree Consultants Ltd)</li>" +
				"<li>LG</li>" +
				"<li>Kyocera</li>" +
				"<li>Many more</li>" +
				"</ul>" +
				"<br>" +
				"From now on we will be concentrating our efforts on 'SKJ Platform'. Our motto is <b>Software + Knowledge = Job well done!&#153;</b>") ;
		
		rp.add(profile, 25, 100) ;
	}

	public void onResize(ResizeEvent event) 
	{
		
		
	}
	
	public void onMouseOver(MouseOverEvent event) 
	{
		
	}

	@Override
	public void onMouseOut(MouseOutEvent event)
	{
		
	}

	@Override
	public void onMouseUp(MouseUpEvent event)
	{
		
	}

	@Override
	public void onMouseDown(MouseDownEvent event)
	{
		// TODO Auto-generated method stub
		
	}
}
